package com.gt.quality.system.mapper;

import com.gt.quality.config.handler.EasyBaseMapper;
import com.gt.quality.system.entity.SysRole;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * 角色信息表(SysRole)表数据库访问层
 *
 * @author makejava
 * @since 2026-11-25 16:30:08
 */
@Mapper
public interface SysRoleMapper extends EasyBaseMapper<SysRole> {

    @Select("select main.role_id,main.tenant_id,main.role_name,main.role_key from sys_role main left join sys_user_role sur on sur.role_id = main.role_id where sur.user_id = #{userId}")
    List<SysRole> selectByUserId(@Param("userId") Long userId);
}

